﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;

namespace A2DFramework.SQLDispatcherService
{
    public class SQLDispatcherContext
    {
        [ThreadStatic]
        internal static SQLDispatcherContext CurrentSQLDispatcherContext = null;

        public string Region { get; set; }

        public static SQLDispatcherContext GetCurrentContext()
        {
            return CurrentSQLDispatcherContext ?? new SQLDispatcherContext() {   Region=string.Empty};
        }
        internal static void SetCurrentContext(SQLDispatcherContext ctx)
        {
            CurrentSQLDispatcherContext = ctx;
        }

        internal static void ResetCurrentContext()
        {
            CurrentSQLDispatcherContext = null;
        }
    }
}
